<?php
include("../config.php");
$encode = base64_encode($_SERVER["REMOTE_ADDR"]);
$json = json_decode(file_get_contents("./Cache/admin.txt"),true);
$Cache_pwd=$json[$encode]?$json[$encode]:"0";
if($Cache_pwd<time())
{
exit("<script language='javascript'>alert('请先登陆！');window.location.href='./login.php';</script>");
}
$data = file_get_contents("../jiekou.json");//接口数量读取
$result = preg_match_all('/{"标题":"(.*?)","小标题":"(.*?)","地址":"(.*?)","密钥":"(.*?)","状态":"(.*?)"}/',$data,$v);//接口总数量
$目录 = file_get_contents("../template/youqing.php");//友链数量读取
$友情 = preg_match_all("/『名字：(.*?)』『链接：(.*?)』『介绍：(.*?)』『QQ：(.*?)』『状态：已添加』/",$目录,$v);//友链总数量
?>

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title><?php echo $web["ming"]; ?>API - 后台首页</title>
<link rel="icon" href="http://q2.qlogo.cn/headimg_dl?dst_uin=<?php echo $web["qq"]; ?>&spec=5" type="image/ico">
<meta name="keywords" content="<?php echo $web["keywords"]; ?>">
<meta name="description" content="<?php echo $web["description"]; ?>">
<meta name="author" content="yinqi">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/materialdesignicons.min.css" rel="stylesheet">
<link href="css/style.min.css" rel="stylesheet">
</head>
  
<body>

<div class="lyear-layout-web">
  <div class="lyear-layout-container">

<?php require_once("./head.php")?>
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-primary">
              <div class="card-body clearfix">
                <div class="pull-right">
                  <p class="h6 text-white m-t-0">接口数量</p>
                  <p class="h3 text-white m-b-0 fa-1-5x"><?php echo $result; ?>个</p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-currency-cny fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-danger">
              <div class="card-body clearfix">
                <div class="pull-right">
                  <p class="h6 text-white m-t-0">友链数量</p>
                  <p class="h3 text-white m-b-0 fa-1-5x"><?php echo $友情; ?>个</p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-account fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-success">
              <div class="card-body clearfix">
                <div class="pull-right">
                  <p class="h6 text-white m-t-0">调用次数</p>
                  <p class="h3 text-white m-b-0 fa-1-5x"><?php echo file_get_contents("../api/tongji/zongtiaoyong/xiaoyu.dat"); ?>次</p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-arrow-down-bold fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
          
          <div class="col-sm-6 col-lg-3">
            <div class="card bg-purple">
              <div class="card-body clearfix">
                <div class="pull-right">
                  <p class="h6 text-white m-t-0">今日调用</p>
                  <p class="h3 text-white m-b-0 fa-1-5x"><?php echo file_get_contents("../api/tongji/jinri/".date("Y-m-d")."/".date("Y-m-d").".dat"); ?>次</p>
                </div>
                <div class="pull-left"> <span class="img-avatar img-avatar-48 bg-translucent"><i class="mdi mdi-comment-outline fa-1-5x"></i></span> </div>
              </div>
            </div>
          </div>
        </div>
        
        <div class="row">
          
          <div class="col-lg-6"> 
            <div class="card">
              <div class="card-header">
                <h4>基本信息</h4>
              </div>
              <div class="card-body">
                <p>本站域名：<?php echo $_SERVER["HTTP_HOST"]; ?></p>
                <p>服务器/虚拟主机端口：<?php echo $_SERVER["SERVER_PORT"];?></p>
                <p>服务器软件：<?php echo $_SERVER["SERVER_SOFTWARE"];?></p>
                <p>囍楽QQ：3038733136</p>
                <p>官方交流群：616247774</p>
                <p>有问题请及时向囍楽反馈</p>
                <p>PS：<?php echo file_get_contents("".$web["tianyi719"]."/update.php"); ?></p>
              </div>
            </div>
          </div>
          
          </div>
    </main>
    <!--End 页面主要内容-->
  </div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="js/main.min.js"></script>


</script>
</body>
</html>